home *** CD-ROM | disk | FTP | other *** search
/ U.S. Robotics Connections 2 / US Robotics Connections.iso / pc / sourcepc / qlmcw / winfiles.pak / COMPUSRV.SRP next >
Encoding:
Text File  |  1996-01-08  |  1.6 KB  |  94 lines

  1. /* Script for connecting to CompuServe */
  2.  
  3. char AccountNumber[40];
  4. char AccountPassword[40];
  5. char PhoneNumber[40];
  6.  
  7. main()
  8. {
  9.     Cls();
  10.     Echo("Please Wait . . .\r\n");
  11.     Echo("Logging on CompuServe\r\n");
  12.     LocalEcho(0);
  13.     Data(7);
  14.     Parity('E');
  15.     Stop("1");
  16.  
  17.     StrCpy(CompuAcct(), AccountNumber);
  18.     StrCpy(CompuPass(), AccountPassword);
  19.     if (!AccountNumber[0] || !AccountPassword[0])
  20.     {
  21.         Echo("Account information incomplete!\r\n");        
  22.         return;
  23.     }    
  24.     if (CompuNetwork() == 0)
  25.         Compu();
  26.     else if (CompuNetwork() == 1)
  27.         Tele();
  28.     else if (CompuNetwork() == 2)
  29.         Tym();
  30.     In("ID:", 15);
  31.     Out(AccountNumber);
  32.     Out("\r");
  33.     In("word:", 15);
  34.     Out(AccountPassword);
  35.     Out("\r");
  36. }
  37.  
  38. ScriptOut(char *string)
  39. {
  40.     Echo(string);
  41.     Out(string);
  42. }
  43.  
  44. Compu()
  45. {
  46.     Echo("At 7-E-1\r\n");
  47.     StrCpy(CompuPhone(), PhoneNumber);
  48.     if (PhoneNumber[0])
  49.         Dial(PhoneNumber);
  50.     else
  51.         Echo("No phone number specified in Services Setup!\r\n");
  52.     Wait(2);
  53.     Out("\r");
  54.     In("Name:", 15);
  55.     Out("CIS\r");
  56. }
  57.  
  58. Tele()
  59. {
  60.     Echo("Via Telenet, At 7-E-1\r\n");
  61.     StrCpy(TelenetPhone(), PhoneNumber);
  62.     if (PhoneNumber[0])
  63.         Dial(PhoneNumber);
  64.     else
  65.         Echo("No phone number specified in Services Setup!\r\n");
  66.     Wait(1);
  67.     if ((CurrentBaud() == 300) || (CurrentBaud() == 1200))
  68.         Out("\r");
  69.     else
  70.         Out("@");
  71.     Wait(1);
  72.     Out("\r");
  73.     In("TERMINAL=", 10);
  74.     Out("\r");
  75.     In("@", 10);
  76.     Out("C 202202\r");
  77. }
  78.  
  79. Tym()
  80. {
  81.     Echo("Via Tymnet, 7-E-1\r\n");
  82.     StrCpy(TymnetPhone(), PhoneNumber);
  83.     if (PhoneNumber[0])
  84.         Dial(PhoneNumber);
  85.     else
  86.         Echo("No phone number specified in Services Setup!\r\n");
  87.     Wait(2);
  88.     Out("A");
  89.     In("in", 15);
  90.     Out("CPS");
  91.     Out("\r");
  92. }
  93.  
  94.